package org.zbclan.bf2.rcon.event;

import java.util.Collection;

import org.zbclan.bf2.rcon.model.LocalProfile;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class ListLocalProfilesEvent extends
		GwtEvent<ListLocalProfilesEvent.Handler> {

	public interface Handler extends EventHandler {

		Type<Handler> TYPE = new Type<Handler>();

		void onEvent(ListLocalProfilesEvent event);
	}

	private final Collection<LocalProfile> profiles;

	public ListLocalProfilesEvent(Collection<LocalProfile> profiles) {
		this.profiles = profiles;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return Handler.TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onEvent(this);
	}

	public Collection<LocalProfile> getProfiles() {
		return profiles;
	}
}
